package com.lxy.seata.controller;

import com.lxy.seata.service.TAccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.math.BigDecimal;

/**
 * @author lixinyang
 * @className: TAccountController
 * @description: TODO
 * @date 2022/05/02日  23:12
 */

@RestController
public class TAccountController {
    @Autowired
    private TAccountService tAccountService;
    @PostMapping("/account/decrease")
    int decrease(@RequestParam("userId") Long userId, @RequestParam("money") BigDecimal money) throws InterruptedException {
        int decrease = tAccountService.decrease(userId, money);
        return decrease;
    }
}
